# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年03月17日
"""
import openpyxl

myBook = openpyxl.load_workbook('运动员表.xlsx',data_only=True)
mySheet1=myBook['篮球赛']
mySheet2=myBook['足球赛']
mySheet3=myBook['乒乓球赛']
mySet1=set(list(mySheet1.values)[1:])
mySet2=set(list(mySheet2.values)[1:])
mySet3=set(list(mySheet3.values)[1:])

mySet4=mySet1.intersection(mySet2,mySet3)
mySheet4=myBook.copy_worksheet(mySheet1)
mySheet4.title='三种比赛'
while mySheet4.max_row>1:
	mySheet4.delete_rows(2)

for myRow in mySet4:
	mySheet4.append(myRow)

myBook.save('结果表-运动员表.xlsx')